package com.itheima.sh.c_cookie_03;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/cookieDemo02Servlet")
public class CookieDemo02Servlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        /*
            需求:在Servlet中获取前一个案例存入在Cookie对象中的数据
            注意：
                1.在同一个会话过程中获取的cookie是同一个域名下的
                    说明：你访问localhost的服务器只能携带localhost下面的cookie
                2.获取请求的cookie信息，使用request对象调用方法 Cookie[] getCookies()
         */


    }
}
